import React from 'react';
import { Form, Input, Button } from 'antd';
import { FormList } from '@ecoding/components.antd';
import { ruleRequired } from '@ecoding/components.antd.rules';

const C = () => {
    const [form] = Form.useForm(); 

    return (
        <Form form={form} preserve={false} layout="vertical">
            <FormList
                name="columnParams"
                operation={{
                    width: 130,
                    render: (field, index) => {
                        return (
                            <Button size="small">自定义按钮</Button>
                        )
                    }
                }}
                columns={[
                    {
                        require: true,
                        title: '源表头名',
                        width: 400,
                        rules: [ruleRequired("必填")],
                        name: 'sourceColumn',
                        render: (field, index) => (
                            <Input  />
                        )
                    }
                ]}
            />
        </Form>
    );
}

export default C;